import {MenuBar} from '@/components'
import {useLocation} from 'umi'
import {StoreProvider} from 'think-react-store'
import * as store from '../stores'
import {NavBar, Icon} from 'antd-mobile'
import {storage} from '@/utils'


function BasicLayout(props) {
  const location = useLocation()

  const menus = storage.get('menus') || []

  const paths = menus.map(item=>item.url)

  return (
    <StoreProvider store={store}>
      <MenuBar
        show={paths.includes(location.pathname)}
        pathname={location.pathname}
      ></MenuBar>
      {props.children}
    </StoreProvider>
  )
}

export default BasicLayout
